/*
 * Created on Jun 10, 2005
 *
 */
package com.erclab.internal.xpresso.dataAccess;

/**
 * @author Enrique Rodriguez.
 *
 */
public class Query {

	protected String query;
	protected String[] values;

	/**
	 * @return
	 */
	public String getQuery() {
		return query;
	}

	/**
	 * @return
	 */
	public String[] getValues() {
		return values;
	}

	/**
	 * @param string
	 */
	public void setQuery(String string) {
		query = string;
	}

	/**
	 * @param strings
	 */
	public void setValues(String[] strings) {
		values = strings;
	}
	
	public void addValueToQuery(String newValue) {
		String[] newValues = null;
		if (this.values != null){
			newValues = new String[this.values.length + 1];
			for (int i = 0; i < this.values.length; i ++){
				newValues[i] = this.values[i];
			}
			newValues[this.values.length] = newValue;
			this.setValues(newValues);
		} else {
			this.setValues(new String[]{newValue});			
		}
		
	}

}
